var util=require('../../utils/util.js');
var voice=require('../../utils/voiceorder.js');
Page({

  /**
   * 页面的初始数据
   */
  data: {
    content:'',
    file:''
  },
  startVtoT:function(){
    var that=this;
    voice.startVoice(function(succ,text,file){
      if (succ){
        that.setData({
          content: text,
          file: file
        })
      }
    })
  },
  stopVToT:function(){
    voice.stopVoice(function(){

    })
  },
  bindInput:function(e){
    this.setData({
      content:e.detail.value
    })
  },
  bindsubmit:function(){
    var url = util.url.user_suggest;
    var data={content:this.data.content}
    util.fetchPost(
      url,
      data,
      function(ret){
        if (ret.data.id){
          util.showinfo("提交成功");
          wx.navigateBack();
        }
      }
    )
  }
})